package hr.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 部门信息表
 * </p>
 *
 * @author zzh
 * @since 2023-12-04
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "Departments对象", description = "部门信息表")
public class Department implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("部门ID")
    @TableId(value = "department_id", type = IdType.AUTO)
    private Long departmentId;

    @ApiModelProperty("部门名称")
    private String departmentName;

    @ApiModelProperty("上级部门ID")
    private Long parentDepartmentId;

    @ApiModelProperty("负责人")
    private Long employeeId;

    @ApiModelProperty("部门状态")
    private Integer departmentState;

    @ApiModelProperty("创建时间")
    private Long createTime;

    private Byte isDelete;

    @TableField(exist = false)
    private Integer stateFlag;

    public Department(Long departmentId, String departmentName, Long parentDepartmentId, Long employeeId, Integer departmentState, Long createTime, Byte isDelete) {
        this.departmentId = departmentId;
        this.departmentName = departmentName;
        this.parentDepartmentId = parentDepartmentId;
        this.employeeId = employeeId;
        this.departmentState = departmentState;
        this.createTime = createTime;
        this.isDelete = isDelete;
    }


    public void setDepartmentState(Integer departmentState) {
        this.departmentState = departmentState;
        this.stateFlag = departmentState;
    }
}
